{{ $cfg := (site.Params.node) }}
{{ $id := (.File.UniqueID) }}
{{ $answer := (.Resources.Match "answer.*.md") }}

<article class="node-{{ (.Type) }} d-flex overflow-hidden">
    {{ if (and ($cfg.cover.enabled)) }}
      <div class="flex-shrink-0 me-3">
        <div class="node-cover">
            {{ (partial "module/node/cover/01" .) }}
        </div>
      </div>
    {{ end }}
  <div class="flex-grow-1 overflow-hidden">
    <div class="d-flex flex-column h-100">
      <header>
        <div class="node-title">
          <h2 class="h5">
            <a href="{{ (.RelPermalink) }}">{{ (.Title) }}</a>
          </h2>
        </div>
      </header>
      <div class="node-body">
          {{ ((.Render "summary") | truncate 100) }}
      </div>
        {{ with (($answer) | len) }}
          <div class="mt-auto text-end">
            <a class="btn btn-sm btn-success d-inline-flex align-items-center" href="#" role="button"
               data-bs-toggle="modal" data-bs-target="#modal-{{ ($id) }}">
              <span class="pe-1"><i class="fas fa-check fa-fw"></i></span>
              <span>{{ (i18n "answer_count" .) }}</span>
            </a>
          </div>
        {{ end }}
    </div>
  </div>
</article>
